package patten.xingwei.strategy;

import java.util.ArrayList;

/**
 * Description：TODO
 * Author：zwenzhi
 * Date：2023/11/16 16:07
 */
public class Impl {
    public static void main(String[] args) throws Exception {
        ClothSearchStrategy clothSearchStrategy = new ClothSearchStrategy();
        FoodSearchStrategy foodSearchStrategy = new FoodSearchStrategy();
        ArrayList<SearchStrategy> searchStrategies = new ArrayList<>();
        searchStrategies.add(clothSearchStrategy);
        searchStrategies.add(foodSearchStrategy);

        SearchStrategyContext searchStrategyContext = new SearchStrategyContext(searchStrategies);
        searchStrategyContext.search("Food","手抓饼");
        searchStrategyContext.search("Cloth","冲锋衣");
    }
}
